<?php
require 'settings.php';
require 'db.php';
?>

<html>
<head>
<title><?php echo $corp_name?> Industry Manager - Add a BPO to library</title>
</head>
<body>
<h1 class=c_page_title>Add an original blueprint to library</h1>
<h2 class="c_step_num">Step 2</h2>

<?php
$category = $_POST['bpo_category'];
if (0 == $category )
{
	echo "You must choose a category!!!";
}
else
{
$category_name = "";
$get_bpo_category_by_id->bind_param( 'i', $category );
$get_bpo_category_by_id->bind_result( $category_name );
$get_bpo_category_by_id->execute();
$get_bpo_category_by_id->fetch();
echo "Category chosen: ".$category_name."<br/>";
$get_bpo_category_by_id->close();
}
?>

<form id="bpo_lib_add_step2" action="add_bpo_to_library3.php" method="post">
	<select name="bpo_id">
	<option value="0">---Choose blueprint---</option>
	<?php
		//code to get all blueprint in current category
		$get_bpos_in_category->bind_param( 'i', $category );
		$get_bpos_in_category->bind_result( $bpo_typeid, $bpo_name );
		$get_bpos_in_category->execute();
		while( $get_bpos_in_category->fetch() )
		{
				echo '<option value="'.$bpo_typeid.'">'.$bpo_name.'</option>'."\n";
		}
		$get_bpos_in_category->close();
	?>
	</select>
	<label for="me_val">ME level:</label>
	<input name="me_val" type="text" value="0" />
	<label for="pe_val">PE level:</label>
	<input name="pe_val" type="text" value="0" />
	<label for="count">Count:</label>
	<input name="count" type="text" value="1" />
	<br />
	<input type="submit" value="Add it!" />
</form>

<br />
<a href="add_bpo_to_library1.php">Back to Step 1</a>
<br />
<a href="index.php">Back to main screen</a>
</body>
</html>
